<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzb.erp.api.pc.clazz.mapper.GradeMapper">

    <select id="getList" resultType="com.hzb.erp.api.pc.clazz.pojo.GradeVO">
        select t1.*,
        t2.name creator_name
        from grade t1
        left join staff t2 on t2.id = t1.creator
        <where>
            t1.deleted = 0
            <if test="param.creator != null">
                AND t1.creator = #{param.creator}
            </if>
            <if test="param.title != null and param.title != ''">
                AND t1.title like concat('%', #{param.title}, '%')
            </if>
        </where>
        order by t1.id desc
    </select>
</mapper>
